<include file="../header" />
<body class="J_scroll_fixed">

<style type="text/css">
    .btn-danger,.btn-info,.btn-success,.btn-warning{
        width: 60px;
        /*height: 18px;*/
        padding: 2px 0px 2px 0px;
        margin: 1px 0px 1px 0px;
    }
</style>
<script type="text/javascript">
    function del(id, name) {
        if (!confirm("是否删除批号【" + name + "】")) {
            return false;
        }
        var url = "/admin/BatchNo/remove?id=" + id;
        window.location.href = url;
    }
</script>
<form class="well form-search" method="post" style="float:left;width:100%;" action="{:U('BatchNo/index')}">
    <div class="search_type cc mb10">
        <div class="mb10">
        <span class="mr20">
            患者：<input type="text" name="p#patient_name-like" value="{$patient_name}" />
            生产批号：<input type="text" name="bn#batch_no-like" value="{$batch_no}" />
            检验单号：<input type="text" name="bn#audit_no-like" value="{$audit_no}" />
            <button class="btn btn-primary">搜索</button>
            <a class="btn" href="{:U('BatchNo/index')}">重置</a>
        </span>
        </div>
    </div>
</form>
<div class="wrap J_check_wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:U('BatchNo/index')}">批号列表</a></li>
        <li><a href="{:U('BatchNo/add')}">新增批号</a></li>
    </ul>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th style="min-width: 100px; width: 100px">患者</th>
            <th style="min-width: 200px; width: 200px">矫形器类型</th>
            <th style="min-width: 100px; width: 100px">生产批号</th>
            <th style="min-width: 100px; width: 100px">检验单号</th>
            <th style="min-width: 100px; width: 100px">时间</th>
            <th style="min-width: 100px; width: 100px">更新人</th>
            <th style="min-width: 50px; width: 50px">工单号</th>
            <th style="min-width: 120px; width: 120px">操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="list" item="vo">
            <tr>
                <if condition="$vo.workorder_id gt 0">
                    <td>{$vo.patient_name} {$vo.side}</td>
                    <else/>
                    <td>{$vo.patient}</td>
                </if>
                <if condition="$vo.workorder_id gt 0">
                    <td>{$vo.type_name}</td>
                    <else/>
                    <td>{$vo.type}</td>
                </if>
                <td>{$vo.batch_no}</td>
                <td>{$vo.audit_no}</td>
                <td>{$vo.create_time}</td>
                <td>{$vo.admin_name}</td>
                <td>{$vo.workorder_id}</td>
                <if condition="$vo.workorder_id gt 0">
                    <td></td>
                    <else/>
                    <td>
                        <a class="btn btn-info" href='{:U("BatchNo/edit",array("id"=>$vo["batch_no_id"]))}'>修改</a>
                        <!--<a class="btn btn-info" onclick='javascript:del("{$vo.batch_no_id}","{$vo.patient_name}",0)'>删除</a>-->
                    </td>
                </if>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>